package com.mail.client.ctrl;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试
 *
 * @Author yin_q
 * @Date 2019/8/23 10:48
 * @Email yin_qingqin@163.com
 **/
@RestController
public class HelloCtrl {

    @RequestMapping(value = "/he/a", method = RequestMethod.GET)
    @HystrixCommand(fallbackMethod = "hiError")
    public String hello(String name){
        return "这是mail client, 此次请求由" + name + "请求";
    }

    public String hiError(String name){
        return "hi," + name + " 连接失败";
    }

}
